package com.hwd.gmall.product.controller;

import com.hwd.gmall.common.result.Result;
import com.hwd.gmall.product.service.TestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 测试redis控制层
 *
 * @author 黄伟东/Victor
 * @date 2022/4/23 10:52
 */
@RestController
@RequestMapping(value = "/api/product")
public class TestController {

    @Resource
    private TestService testService;

    /**
     * 往redis中设置值操作
     */
    @PostMapping(value = "/setValue")
    public Result<Object> setValue() {
        testService.setValueRedisson();
        return Result.ok();
    }
}
